from fastapi_amis_admin import amis, admin
from fastapi_amis_admin.admin import AdminApp

from .models import SysDept


class DeptApp(admin.AdminApp):
    page_schema = amis.PageSchema(label='Dept', icon='fa fa-bolt')
    router_prefix = '/dept'

    def __init__(self, app: "AdminApp"):
        super().__init__(app)
        self.register_admin(DeptAdmin)


# Register your models here.

class DeptAdmin(admin.ModelAdmin):
    page_schema = amis.PageSchema(label='Dept', icon='fa fa-folder')
    model = SysDept
    # search_fields = [Dept.name]
